﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Net;
using System.Text;

namespace SDK.ApiService
{
    public class Utils
    {

        /// <summary>
        /// POST 请求
        /// </summary>
        /// <param name="strUrl"></param>
        /// <param name="param"></param>
        /// <returns></returns>
        //public static string requestPost(string strUrl, string param)
        //{
        //    HttpWebRequest httpWebRequest = WebRequest.Create(strUrl) as HttpWebRequest;
        //    httpWebRequest.Method = "POST";
        //    httpWebRequest.ContentType = "application/x-www-form-urlencoded";
        //    byte[] data = Encoding.UTF8.GetBytes(param);
        //    using (Stream stream = httpWebRequest.GetRequestStream())
        //    {
        //        stream.Write(data, 0, data.Length);
        //    }
        //    WebResponse webResponse = httpWebRequest.GetResponse() as HttpWebResponse;
        //    Stream dataStream = webResponse.GetResponseStream();
        //    StreamReader reader = new StreamReader(dataStream, Encoding.UTF8);
        //    string returnStr = reader.ReadToEnd();
        //    reader.Close();
        //    webResponse.Close();
        //    return returnStr;
        //}
    }
}
